package com.example.websocket.service.impl;

import com.example.websocket.dao.AddFriendRequestMapper;
import com.example.websocket.entity.AddFriendRequest;
import com.example.websocket.service.IAddFriendRequestService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class AddFriendRequestServiceImpl implements IAddFriendRequestService {
    @Autowired
    AddFriendRequestMapper addFriendRequestMapper;

    @Override
    public int deleteByPrimaryKey(Integer id) {
        return addFriendRequestMapper.deleteByPrimaryKey(id);
    }

    @Override
    public int insert(AddFriendRequest record) {
        return addFriendRequestMapper.insert(record);
    }

    @Override
    public AddFriendRequest selectByPrimaryKey(Integer id) {
        return addFriendRequestMapper.selectByPrimaryKey(id);
    }

    @Override
    public int updateByPrimaryKey(AddFriendRequest record) {
        return addFriendRequestMapper.updateByPrimaryKey(record);
    }

    @Override
    public List<AddFriendRequest> selectByToUserid(int id) {
        return addFriendRequestMapper.selectByToUserid(id);
    }

    @Override
    public AddFriendRequest selectByUserAndToUserid(int userid, int toUserid) {
        return addFriendRequestMapper.selectByUserAndToUserid(userid,toUserid);
    }
}
